'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
	const collection = db.collection('message-list')
	let info = { ...event}
	let time = new Date(Date.now() + (8 * 60 * 60 * 1000))
	info.addTime = time.toLocaleDateString() + '  ' + time.toLocaleTimeString()
	info.sendTime = `${event.year}-${event.month}-${event.day}  ${event.hour}:00:00`
	const res = await collection.add(info)
	return res
};
